#ifndef KEYCOUNTSERVER_CLIENTNET_H_
#define KEYCOUNTSERVER_CLIENTNET_H_

namespace KeyCountServer {

class ClientNet
{
public:
    ClientNet(Client *client, int clientId);
    bool handle();

private:
    bool getHead();
    bool getMsg();
    bool putHead();
    bool putMsg();
    
    void doRegister();
    void doLogin();
    void doUpload();
    void doDownload();
    void doLogout();
    
    bool addUser();
    void delUser();
    
public:
    char        *m_msgGet, *m_msgPut;

private:
    Client      *m_client;
    IOWrapper   *m_iow;
    msgHead     m_msghGet, m_msghPut;
    char        m_username[MAX_LEN], m_password[MAX_LEN];
    ClientLocal *m_local;
    bool        m_online;
    int         m_clientId;
};

}

#endif
